<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改账户入账申请')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: bootstrap-fileinput-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-record-edit" th:object="${accountApplyRecord}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">操作日期：</label>
                <div class="col-sm-8">
                    <input  th:field="*{dateInfo}" readonly class="form-control" type="text" >
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">账单日期：</label>
                <div class="col-sm-8">
                    <input name="billDateInfo" th:field="*{billDateInfo}" class="form-control" type="text" >
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">子账户类型：</label>
                <div class="col-sm-8">
                    <input th:field="*{itemAccountType}" readonly class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">子账户名称：</label>
                <div class="col-sm-8">
                    <input th:field="*{itemAccountName}" readonly class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">操作类型：</label>
                <div class="col-sm-8">
                    <input th:field="*{actionType}" readonly class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">总账户信息：</label>
                <div class="col-sm-8">
                    <select name="mainAccountId" class="form-control" th:field="*{mainAccountId}">
                        <option value="">暂无</option>
                        <option  th:each="item:${accountInfoList}" th:text="${item.name}" th:value="${item.value}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">备注信息：</label>
                <div class="col-sm-8">
                    <textarea name="remarkInfo" class="form-control">[[*{remarkInfo}]]</textarea>
                </div>
            </div>
<!--            <div class="form-group">-->
<!--                <label class="col-sm-3 control-label">状态：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <select name="status" class="form-control" th:field="*{status}">-->
<!--                        <option  th:each="item:${statusList}" th:text="${item.name}" th:value="${item.value}"></option>-->
<!--                    </select>-->
<!--                    <span style="color: red">说明：待处理 申请才会进行通知处理；</span>-->
<!--                </div>-->
<!--            </div>-->

            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">入账金额：</label>
                <div class="col-sm-8">
                    <input name="billAmount" th:field="*{billAmount}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">账单图片：</label>
                <div class="col-sm-8">
                    <img alt="[入账图片]" width="90px" height="60px"  src="" id="imageUrl_img" th:src="*{imgUrl}" />
                    <input name="imgUrl" id="imageUrl" class="form-control" type="hidden" required>
                    <input id="inputImage" name="file" type="file">
                </div>
            </div>
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label is-required">创建者id：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="creatorId" th:field="*{creatorId}" class="form-control" type="text" required>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label is-required">创建者姓名：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="creatorName" th:field="*{creatorName}" class="form-control" type="text" required>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">更新者ID：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="updatorId" th:field="*{updatorId}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">更新者姓名：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="updatorName" th:field="*{updatorName}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label is-required">：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <div class="input-group date">-->
<!--                        <input name="createTime" th:value="${#dates.format(accountApplyRecord.createTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" required>-->
<!--                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>-->
<!--                    </div>-->
<!--                </div>-->
<!--            </div>-->
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <th:block th:include="include :: bootstrap-fileinput-js" />
    <script th:inline="javascript">
        var prefix = ctx + "account/record";
        $("#form-record-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-record-edit').serialize());
            }
        }

        $(document).ready(function () {
            // 单图上传
            $("#inputImage").fileinput({
                uploadUrl: ctx + 'common/upload/bill',
                maxFileCount: 1,
                autoReplace: true
            }).on('fileuploaded', function (event, data, previewId, index) {
                var rsp = data.response;
                // log.info("return url：" + rsp.url)
                // log.info("reutrn fileName：" + rsp.fileName)
                // log.info("reutrn newFileName：" + rsp.newFileName)
                // log.info("return originalFilename：" + rsp.originalFilename)
                $("#imageUrl").val(rsp.fileUrl)
                $("#imageUrl_img").attr("src", rsp.fileUrl)
            }).on('fileremoved', function (event, id, index) {
                $("input[name='" + event.currentTarget.id + "']").val('')
            })
        });
    </script>
</body>
</html>